window.onload = function () {
    var img = document.getElementsByClassName("Crimg");
    var img2 = document.getElementsByClassName("Smimg");
    var bfa = document.getElementsByClassName("bfa");
    var bf = document.getElementsByClassName("bf");
    var shouqia = document.getElementById("shouqia");
    var shouqi1 = document.getElementsByClassName("shouqi1")[0];
    var shouqi2 = document.getElementsByClassName("shouqi2")[0];
    var audio = document.getElementById("audio");
    var pre = document.getElementsByClassName("pre")[0];
    var start = document.getElementsByClassName("start")[0];
    var next = document.getElementsByClassName("next")[0];
    var total = document.getElementById("total");
    var current = document.getElementById("current");
    var player_current = document.getElementsByClassName("player_current")[0];
    var bar_player = document.getElementsByClassName("bar-player")[0];
    var yl = document.getElementById("yl");
    var jspPane = document.getElementsByClassName("jspPane")[0];
    var donman = document.getElementsByClassName("donman")[0];


    var c = 0, d = 0;
    var time = setInterval(autoRun, 3000);
    var time2 = setInterval(autoRun2, 1000);
    function  run(){
        if (c == img.length) {
            c=0;
        }
        for (var i = 0; i < img.length; i++) {
            img[i].style.display = "none";
        };
        img[c].style.display = "block";
    }
    function autoRun(){
        run();
        c++;
    }
    function  run2(){
        if (c == img2.length) {
            c=0;
        }
        for (var i = 0; i < img.length; i++) {
            img2[i].style.display = "none";
        };
        img2[c].style.display = "block";
    }
    function autoRun2(){
        run2();
        c++;
    }



    bfa[0].onmouseover = function () {
            bf[0].style.display = "block";
    };
    bfa[0].onmouseout = function () {
            bf[0].style.display = "none"
    };

    bfa[1].onmouseover = function () {
        bf[1].style.display = "block";
    };
    bfa[1].onmouseout = function () {
        bf[1].style.display = "none"
    };

    bfa[2].onmouseover = function () {
        bf[2].style.display = "block";
    };
    bfa[2].onmouseout = function () {
        bf[2].style.display = "none"
    };

    bfa[3].onmouseover = function () {
        bf[3].style.display = "block";
    };
    bfa[3].onmouseout = function () {
        bf[3].style.display = "none"
    };

    shouqia.onmouseover = function () {
        shouqi1.style.display = "block";
        shouqi2.style.display = "block";
    };
    shouqia.onmouseout = function () {
        shouqi1.style.display = "none"
        shouqi2.style.display = "none"
    };

    start.onclick = function () {
        if (audio.paused) {
            audio.play();
            start.src = "./img/znat.png";
        } else {
            audio.pause();
            start.src = "./img/bafa.png";
        }
    };

    function formatTime(time) {
        var h = Math.floor(time / 3600);
        var m = Math.floor(time % 3600 / 60);
        var s = Math.floor(time % 60);
        return (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":" + (s < 10 ? "0" + s : s);
    }


    var t = setInterval(s, 1000);
    var t = setInterval(function () {
        var totalTime = formatTime(audio.duration);
        total.innerText = totalTime;
    }, 1000);

    function s() {
        var w = audio.currentTime / audio.duration * 100;
        var currentTime = formatTime(audio.currentTime);
        current.innerText = currentTime;
        player_current.style.width = w + '%';
        donman.style.left = (w-3) + '%';
        if (audio.ended) {
            start.src = "./img/bafa.png";
        }
    }


    bar_player.addEventListener("click", function (e) {
        var current = (e.offsetX - 10) / document.body.clientWidth * audio.duration;
        audio.currentTime = current;
        start.onclick();
        if (audio.paused) {
            audio.play();
            start.src = "./img/znat.png";
        }
    });

    yl.onclick = function () {
        if (audio.muted == false) {
            audio.muted = true;
            yl.src = "./img/jinyin.png";
        } else {
            audio.muted = false;
            yl.src = "./img/laba.png";
        }
    };

    var onyl = document.getElementsByClassName("onyl")[0];
    yl.onmouseover = function () {
        onyl.style.display = 'block';
    };
    yl.onmouseout = function () {
        onyl.style.display = 'none';
    };

    onyl.onmouseover = function () {
        onyl.style.display = 'block';
    };
    onyl.onmouseout = function () {
        onyl.style.display = 'none';
    };
    var ylcount = document.getElementsByClassName("ylcount")[0];
    var player_yl = document.getElementsByClassName("player_yl")[0];
    player_yl.addEventListener("click", function (e) {
        if (e.offsetY >= 0 && e.offsetY <= 240) {
            var v = 1 - e.offsetY / 240;
            console.log(v)
            player_yl.style.paddingTop = String(240-(v * 240)) + 'px';
            player_yl.style.height = String(240-(240 - v * 240)) + 'px';
            ylcount.innerText = Math.floor(v * 100) + '%';
            audio.volume = v;
        }
    });
    var musizJSON = [
        {
            "code":1,
            "图片":"https://imgessl.kugou.com/stdmusic/20150718/20150718113957197635.jpg",
            "歌名":"有何不可 许崇",
            "url":"http://header-file.gitee.io/mmsg_1/有何不可.mp3"
        },
        {
            "code":2,
            "图片":"https://imgessl.kugou.com/stdmusic/20160907/20160907192633928797.jpg",
            "歌名":"演员  薛之谦",
            "url":"http://header-file.gitee.io/mmsg_1/演员.mp3"
        },
        {
            "code":3,
            "图片":"https://imgessl.kugou.com/stdmusic/20150715/20150715184807521489.jpg",
            "歌名":"丑八怪 薛之谦",
            "url":"http://header-file.gitee.io/mmsg_1/丑八怪.mp3"
        },
        {
            "code":4,
            "图片":"https://imgessl.kugou.com/stdmusic/20220714/20220714213006413283.jpg",
            "歌名":"最伟大作品 周杰伦",
            "url":"http://header-file.gitee.io/mmsg_1/最伟大作品 周杰伦.mp3"
        },
        {
            "code":5,
            "图片":"https://imgessl.kugou.com/stdmusic/20160907/20160907190357712844.jpg",
            "歌名":"一路向北 周杰伦",
            "url":"http://header-file.gitee.io/mmsg_1/一路向北.mp3"
        },
        {
            "code":6,
            "图片":"https://imgessl.kugou.com/stdmusic/20170815/20170815153649561196.jpg",
            "歌名":"国王与乞丐 华晨宇",
            "url":"http://header-file.gitee.io/mmsg_1/国王与乞丐.mp3"
        },
        {
            "code":7,
            "图片":"https://imgessl.kugou.com/stdmusic/20200428/20200428194948440377.jpg",
            "歌名":"不分手的恋爱 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/不分手的恋爱.mp3"
        },
        {
            "code":8,
            "图片":"https://imgessl.kugou.com/stdmusic/20200428/20200428194948440377.jpg",
            "歌名":"小星星 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/小星星.mp3"
        },
        {
            "code":9,
            "图片":"https://imgessl.kugou.com/stdmusic/20200428/20200428194948440377.jpg",
            "歌名":"那个男孩 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/那个男孩.mp3"
        },
        {
            "code":10,
            "图片":"https://imgessl.kugou.com/stdmusic/20200428/20200428194948440377.jpg",
            "歌名":"万有引力 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/万有引力.mp3"
        },
        {
            "code":11,
            "图片":"https://imgessl.kugou.com/stdmusic/20160825/20160825095908368301.jpg",
            "歌名":"一笑倾城 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/一笑倾城.mp3"
        },
        {
            "code":12,
            "图片":"https://imgessl.kugou.com/stdmusic/20160907/20160907200622382053.jpg",
            "歌名":"风度 汪苏泷",
            "url":"http://header-file.gitee.io/mmsg_1/风度.mp3"
        },
        {
            "code":13,
            "图片":"https://p3fx.kgimg.com/stdmusic/240/20221104/20221104111152496659.jpg",
            "歌名":"星星永远发着光  叶洛洛",
            "url":"http://header-file.gitee.io/mmsg_1/星星永远发着光.mp3"
        }];



    var ms1 = document.getElementById("ms1");
    var ms2 = document.getElementById("ms2");
    var ms3 = document.getElementById("ms3");
    var ms4 = document.getElementById("ms4");
    var ms5 = document.getElementById("ms5");
    var ms6 = document.getElementById("ms6");
    var ms7 = document.getElementById("ms7");
    var ms8 = document.getElementById("ms8");
    var ms9 = document.getElementById("ms9");
    var ms10 = document.getElementById("ms10");
    var ms11 = document.getElementById("ms11");
    var ms12 = document.getElementById("ms12");
    var ms13= document.getElementById("ms13");
    var muing = document.getElementsByClassName("muing")[0];
    var marquee = document.getElementById("marquee");

    var musizname = document.getElementsByClassName("musizname")[0];
    var muser = document.getElementsByClassName("muser")[0];
    console.log(marquee)
    var current_audio = 6;
    ms1.onclick = function ms1f() {
        audio.src = musizJSON[0].url;
        muing.src = musizJSON[0].图片;
        marquee.innerText = musizJSON[0].歌名;
        current_audio = 1;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[0].歌名.split(" ")[0]
        muser.innerText = musizJSON[0].歌名.split(" ")[1]
    };

    ms2.onclick = function () {
        audio.src = musizJSON[1].url;
        muing.src = musizJSON[1].图片;
        marquee.innerText = musizJSON[1].歌名;
        current_audio = 2;
        audio.play();
        start.src = "./img/zant.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[1].歌名.split(" ")[0]
        muser.innerText = musizJSON[1].歌名.split(" ")[1]
    };
    ms3.onclick = function () {
        audio.src = musizJSON[2].url;
        muing.src = musizJSON[2].图片;
        marquee.innerText = musizJSON[2].歌名;
        current_audio = 3;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[2].歌名.split(" ")[0]
        muser.innerText = musizJSON[2].歌名.split(" ")[1]
    };
    ms4.onclick = function () {
        audio.src = musizJSON[3].url;
        muing.src = musizJSON[3].图片;
        marquee.innerText = musizJSON[3].歌名;
        current_audio = 4;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[3].歌名.split(" ")[0]
        muser.innerText = musizJSON[3].歌名.split(" ")[1]
    };
    ms5.onclick = function () {
        audio.src = musizJSON[4].url;
        muing.src = musizJSON[4].图片;
        marquee.innerText = musizJSON[4].歌名;
        current_audio = 5;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;

        musizname.innerText = musizJSON[4].歌名.split(" ")[0]
        muser.innerText = musizJSON[4].歌名.split(" ")[1]
    };
    ms6.onclick = function () {
        audio.src = musizJSON[5].url;
        muing.src = musizJSON[5].图片;
        marquee.innerText = musizJSON[5].歌名;
        current_audio = 6;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;

        musizname.innerText = musizJSON[5].歌名.split(" ")[0]
        muser.innerText = musizJSON[5].歌名.split(" ")[1]
    };
    ms7.onclick = function () {
        audio.src = musizJSON[6].url;
        muing.src = musizJSON[6].图片;
        marquee.innerText = musizJSON[6].歌名;
        current_audio = 7;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[6].歌名.split(" ")[0]
        muser.innerText = musizJSON[6].歌名.split(" ")[1]
    };
    ms8.onclick = function () {
        audio.src = musizJSON[7].url;
        muing.src = musizJSON[7].图片;
        marquee.innerText = musizJSON[7].歌名;
        current_audio = 8;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[7].歌名.split(" ")[0]
        muser.innerText = musizJSON[7].歌名.split(" ")[1]
    };
    ms9.onclick = function () {
        audio.src = musizJSON[8].url;
        muing.src = musizJSON[8].图片;
        marquee.innerText = musizJSON[8].歌名;
        current_audio = 9;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[8].歌名.split(" ")[0]
        muser.innerText = musizJSON[8].歌名.split(" ")[1]
    };
    ms10.onclick = function () {
        audio.src = musizJSON[9].url;
        muing.src = musizJSON[9].图片;
        marquee.innerText = musizJSON[9].歌名;
        current_audio = 10;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[9].歌名.split(" ")[0]
        muser.innerText = musizJSON[9].歌名.split(" ")[1]
    };
    ms11.onclick = function () {
        audio.src = musizJSON[10].url;
        muing.src = musizJSON[10].图片;
        marquee.innerText = musizJSON[10].歌名;
        current_audio = 11;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[10].歌名.split(" ")[0]
        muser.innerText = musizJSON[10].歌名.split(" ")[1]
    };
    ms12.onclick = function () {
        audio.src = musizJSON[11].url;
        muing.src = musizJSON[11].图片;
        marquee.innerText = musizJSON[11].歌名;
        current_audio = 12;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[11].歌名.split(" ")[0]
        muser.innerText = musizJSON[11].歌名.split(" ")[1]
    };
    ms13.onclick = function () {
        audio.src = musizJSON[12].url;
        muing.src = musizJSON[12].图片;
        marquee.innerText = musizJSON[12].歌名;
        current_audio = 13;
        audio.play();
        start.src = "./img/znat.png";
        jspPane.scrollTop = 0;
        musizname.innerText = musizJSON[12].歌名.split(" ")[0]
        muser.innerText = musizJSON[12].歌名.split(" ")[1]
    };

    var pre = document.getElementsByClassName("pre")[0];
    var next = document.getElementsByClassName("next")[0];
    pre.onclick = function () {
        var new_audio = current_audio - 1 > 0?current_audio - 1:0;
        audio.src = musizJSON[new_audio-1].url;
        muing.src = musizJSON[new_audio-1].图片;
        marquee.innerText = musizJSON[new_audio-1].歌名;
        current_audio = new_audio;
        audio.play();
        start.src = "./img/znat.png";
    };
    next.onclick = function () {
        var new_audio = current_audio + 1 < 13?current_audio + 1:13;
        audio.src = musizJSON[new_audio-1].url;
        muing.src = musizJSON[new_audio-1].图片;
        marquee.innerText = musizJSON[new_audio-1].歌名;
        current_audio = new_audio;
        audio.play();
        start.src = "./img/znat.png";
    };
    var musizlist = document.getElementsByClassName("musizlist")[0];
    shouqia.onclick = function () {
        if (musizlist.style.display == "none") {
            musizlist.style.display = "block";
            shouqi1.src = "./img/down.png";
            shouqi2.src = "./img/down1.png";
        } else {
            musizlist.style.display = "none";
            shouqi1.src = "./img/shouqi1.png";
            shouqi2.src = "./img/shouq.png";
        }
    };

    function parselyr(text) {
        var lyr = text.split('\\n');
        var result = [];

        for (var i = 0; i < lyr.length; i++) {
            var playTime = lyr[i].match(/\[\d{2}:\d{2}((\.|\:)(\d{3}|\d{2}))\]/g);
            var line = "";
            if (lyr[i].split(playTime).length > 0) {
                line = lyr[i].split(playTime);
            }
            if (playTime != null) {
                for (var j = 0; j < playTime.length; j++) {
                    var time = playTime[j].substring(1, playTime[j].indexOf("]")).split(":");
                }
                result.push({
                    time : (parseInt(time[0]) * 60 + parseFloat(time[1])).toFixed(4),
                    content: String(line).substr(1)
                })
            }
        }
        return result;
    }

    var textList = [
        "[00:00.000] 作词 : 无\\n[00:01.000] 作曲 : 无\\n[00:02.000] 编曲 : 无\\n[00:04.032]作词 : 许嵩\\n[00:04.570]作曲 : 许嵩\\n[00:05.041]编曲 : 许嵩\\n[00:23.057]天空好像下雨\\n[00:25.427]我好像住你隔壁\\n[00:28.397]傻站在你家楼下\\n[00:29.554]抬起头数乌云\\n[00:31.841]如果场景里出现一架钢琴\\n[00:34.152]我会唱歌给你听\\n[00:37.158]哪怕好多盆水往下淋\\n[00:41.998]夏天快要过去\\n[00:44.517]请你少买冰淇淋\\n[00:46.450]天凉就别穿短裙\\n[00:48.511]别再那么淘气\\n[00:50.955]如果有时不那么开心\\n[00:53.386]我愿意将格洛米借给你\\n[00:55.563]你其实明白我心意\\n[00:59.040]为你唱这首歌没有什么风格\\n[01:01.329]它仅仅代表着我想给你快乐\\n[01:08.243]为你解冻冰河为你做一只扑火的飞蛾\\n[01:14.067]没有什么事情是不值得\\n[…99]请你少买冰淇淋\\n[02:21.481]天凉就别穿短裙\\n[02:23.595]别再那么淘气\\n[02:25.952]如果有时不那么开心\\n[02:28.917]我愿意将格洛米借给你\\n[02:30.676]你其实明白我心意\\n[02:34.202]为你唱这首歌没有什么风格\\n[02:39.041]它仅仅代表着我想给你快乐\\n[02:43.699]为你解冻冰河为你做一只扑火的飞蛾\\n[02:49.224]没有什么事情是不值得\\n[02:53.251]为你唱这首歌没有什么风格\\n[02:57.619]它仅仅代表着我希望你快乐\\n[03:02.786]为你辗转反侧为你放弃世界有何不可\\n[03:08.026]夏末秋凉里带一点温热\\n[03:14.962]lalalalalalal...\\n[03:22.247]为你解冻冰河为你做一只扑火的飞蛾\\n[03:27.668]没有什么事情是不值得\\n[03:31.260]为你唱这首歌没有什么风格\\n[03:35.821]它仅仅代表着我希望你快乐\\n[03:42.587]为你辗转反侧为你放弃世界有何不可\\n[03:46.523]夏末秋凉里带一点温热有换季的颜色\\n",
        "[00:00.000] 作词 : 薛之谦\\n[00:00.676] 作曲 : 薛之谦\\n[00:01.352] 编曲 : 郑伟/张宝宇\\n[00:02.028] 制作人 : 赵英俊\\n[00:02.704] 合声 : 赵英俊\\n[00:03.380] 录音师 : 王晓海\\n[00:04.056] 混音师 : 鲍锐\\n[00:04.732] 母带工程师 : 鲍锐\\n[00:05.409]\\n[00:21.056]简单点\\n[00:24.967]说话的方式简单点\\n[00:30.439]递进的情绪请省略\\n[00:33.369]你又不是个演员\\n[00:36.016]别设计那些情节\\n[00:41.795]没意见\\n[00:45.905]我只想看看你怎么圆\\n[00:51.415]你难过的太表面\\n[00:54.338]像没天赋的演员\\n[00:56.937]观众一眼能看见\\n[01:02.295]该配合你演出的我演视而不见\\n[01:07.395]在逼一个最爱你的人即兴表演\\n[01:12.584]什么时候我们开始收起了底线\\n[01:17.824]顺应时代的改变看那些拙劣的表演\\n[01:23.069]可你…]顺着别人的谎言被动就不显得可怜\\n[02:26.002]可你曾经那么爱我干嘛演出细节\\n[02:31.284]我该变成什么样子才能配合出演\\n[02:36.548]原来当爱放下防备后的这些那些\\n[02:41.810]都有个期限\\n[02:47.806]其实台下的观众就我一个\\n[02:52.934]其实我也看出你有点不舍\\n[02:57.957]场景也习惯我们来回拉扯\\n[03:02.763]还计较着什么\\n[03:08.619]其实说分不开的也不见得\\n[03:13.691]其实感情最怕的就是拖着\\n[03:19.010]越演到重场戏越哭不出了\\n[03:24.025]是否还值得\\n[03:28.865]该配合你演出的我尽力在表演\\n[03:34.138]像情感节目里的嘉宾任人挑选\\n[03:39.404]如果还能看出我有爱你的那面\\n[03:44.602]请剪掉那些情节让我看上去体面\\n[03:49.795]可你曾经那么爱我干嘛演出细节\\n[03:55.033]不在意的样子是我最后的表演\\n[04:00.917]是因为爱你我才选择表演\\n[04:05.957]这种成全\\n[04:10.323]\\n",
        "[00:00.000] 作词 : 甘世佳\\n[00:01.000] 作曲 : 李荣浩\\n[00:19.660]如果世界漆黑 其实我很美\\n[00:23.280]在爱情里面进退 最多被消费\\n[00:27.100]无关痛痒的是非\\n[00:29.090]又怎么不对 无所谓\\n[00:35.090]如果像你一样 总有人赞美\\n[00:38.720]围绕着我的卑微 也许能消退\\n[00:42.720]其实我并不在意 有很多机会\\n[00:46.090]像巨人一样的无畏\\n[00:48.910]放纵我心里的鬼\\n[00:50.600]可是我不配\\n[00:53.860]丑八怪 能否别把灯打开\\n[01:01.610]我要的爱 出没在漆黑一片的舞台\\n[01:08.860]丑八怪 在这暧昧的时代\\n[01:16.980]我的存在 像意外\\n[01:23.880]\\n[01:37.190]有人用一滴泪 会红颜祸水\\n[01:40.750]有人丢掉称谓 什么也不会\\n[01:44.690]只要你足够虚伪\\n[01:46.500]就不怕魔鬼 对不对\\n[01:52.450]如果剧本写好 谁比谁高贵\\n[01:56.140]我只能沉默以对 美丽本无罪\\n[02:00.030]当欲望开始贪杯 有更多机会\\n[02:03.470]像尘埃一样的无畏\\n[02:06.290]化成灰谁认得谁管他配不配\\n[02:11.360]丑八怪 能否别把灯打开\\n[02:18.920]我要的爱 出没在漆黑一片的舞台\\n[02:26.230]丑八怪 在这暧昧的时代\\n[02:34.360]我的存在 不意外\\n[03:02.260]丑八怪 其实见多就不怪\\n[03:10.260]放肆去high 用力踩\\n[03:14.450]那不堪一击的洁白\\n[03:17.510]丑八怪 这是我们的时代\\n[03:25.780]我不存在 才意外\\n",
        "纯音乐",
        "纯音乐",
        "[00:00.000] 作词 : 代岳东\\n[00:01.000] 作曲 : Mike Chan/nFaizal Tahir\\n[00:12.860]怎么了 怎么了\\n[00:16.020]一份爱失去了光泽\\n[00:19.330]面对面 背对背\\n[00:22.330]反复挣扎怎么都痛\\n[00:26.060]以为爱坚固像石头\\n[00:29.120]谁知一秒钟就碎落\\n[00:32.560]难道心痛都要不断打磨\\n[00:38.390]抱紧你的我比国王富有\\n[00:45.440]曾多么快乐\\n[00:51.150]失去你的我比乞丐落魄\\n[00:58.490]痛多么深刻\\n[01:05.000]当一切 结束了 安静了 过去了\\n[01:12.000]为什么 还拥有 一万个 舍不得\\n[01:18.780]喔 喔\\n[01:30.940]谁又能感受\\n[01:36.660]回忆里的我比国王富有\\n[01:43.730]奢侈的快乐\\n[01:49.540]失去你以后比乞丐落魄\\n[01:59.940]心痛如刀割\\n[02:07.000]怀念那时你安静陪着我\\n[02:13.070]柔软时光里最美的挥霍\\n[02:19.560]喔\\n[02:22.810]爱有多快乐\\n[02:34.34]痛有多深刻\\n",
        "[00:00.000] 作词 : 汪苏泷\\n[00:01.000] 作曲 : 汪苏泷\\n[00:02.000] 编曲 : 汪苏泷\\n[00:25.90]不知不觉不问 不痛不痒\\n[00:29.16]多少的时光\\n[00:31.60]不确定的某个 夜晚小巷\\n[00:34.68]泪悄悄流淌\\n[00:37.16]街边天气微凉 淡淡月光\\n[00:40.50]我沿路哼唱\\n[00:42.85]找寻我们一直 找不到的\\n[00:46.00]缘分被捆绑\\n[00:48.15]感觉不到你为我坚强\\n[00:50.84]感觉得到你对我说谎\\n[00:53.99]我安静听着肖邦\\n[00:55.78]用维也纳忧伤\\n[00:59.33]你的爱被埋葬 恨被收藏\\n[01:03.03]痛应该原谅\\n[01:04.87]我的爱不用讲 恨不用想\\n[01:08.41]思念在发烫\\n[01:10.50]看着你的脸庞 背着行囊\\n[01:14.05]说要去远方\\n[01:16.25]谁还记得那年我拉着你说\\n[01:21.16]爱永远一样\\n[01:22.53]我也搞不懂为什么那么多真心相爱\\n[01:25.03]到最后 都会变成两…]不确定的某个 夜晚小巷\\n[01:53.73]泪悄悄流淌\\n[01:56.22]街边天气微凉 淡淡月光\\n[01:59.52]我沿路哼唱\\n[02:01.91]找寻我们一直 找不到的\\n[02:05.10]缘分被捆绑\\n[02:07.29]感觉不到你为我坚强\\n[02:09.98]感觉得到你对我说谎\\n[02:12.98]我安静听着肖邦\\n[02:14.78]用维也纳忧伤\\n[02:18.41]你的爱被埋葬 恨被收藏\\n[02:21.86]痛应该原谅\\n[02:23.95]我的爱不用讲 恨不用想\\n[02:27.39]思念在发烫\\n[02:29.55]看着你的脸庞 背着行囊\\n[02:33.03]说要去远方\\n[02:35.18]谁还记得那年我拉着你说\\n[02:40.13]爱永远一样\\n[02:41.17]你的爱被埋葬 恨被收藏\\n[02:44.37]痛应该原谅\\n[02:46.46]我的爱不用讲 恨不用想\\n[02:49.90]思念在发烫\\n[02:52.09]看着你的脸庞 背着行囊\\n[02:55.44]说要去远方\\n[02:57.67]谁还记得那年我拉着你说\\n[03:02.81]爱永远一样\\n",
        "[00:00.000] 作词 : 汪苏泷\\n[00:01.000] 作曲 : 汪苏泷\\n[00:02.000] 编曲 : 汪苏泷\\n[00:16.645]承认不勇敢\\n[00:19.768]你能不能别离开\\n[00:23.562]很多爱不能重来\\n[00:26.995]我应该释怀\\n[00:30.529]在街头徘徊\\n[00:33.545]下雨时为你撑伞\\n[00:37.369]对你的爱成阻碍\\n[00:40.931]祝福你愉快\\n[00:44.699]窗外的天气\\n[00:47.735]像你心忐忑不定\\n[00:51.354]如果这是结局\\n[00:53.437]我希望你是真的满意\\n[00:58.941](希望你能听我)\\n[01:00.737]你 就是我的小星星\\n[01:04.016]挂 在那天上放光明\\n[01:07.352]我已经决定要爱你\\n[01:11.061]就不会轻易放弃\\n[01:11.991](希望你能听我)\\n[01:14.769]海 上流浪的许愿瓶\\n[01:18.075]每 个心愿都是为你\\n[01:21.394]就算不能够在一起\\n[01:25.170]我还是为你担心\\n[01:41.897]wo~窗外的天气\\n[01:45.906]像你心忐忑不定\\n[01:49.425]如果这是结局\\n[01:52.047]我希望你是真的满意\\n[01:57.126](希望你能听我)\\n[01:58.908]你 就是我的小星星\\n[02:02.183]挂 在那天上放光明\\n[02:05.325]我已经决定要爱你\\n[02:09.224]就不会轻易放弃\\n[02:12.858]海 上流浪的许愿瓶\\n[02:16.318]每 个心愿都是为你\\n[02:19.984]就算不能够在一起\\n[02:23.451]我还是为你担心\\n[02:28.732]把 悲伤写成协奏曲\\n[02:32.160]在 角落里为你弹琴\\n[02:35.364]就算你可能听不清\\n[02:39.331]也代表我的心意\\n[02:41.950]也代表我的心\\n[02:42.884]爱 不一定要很甜蜜\\n[02:46.286]说 山盟海誓的言语\\n[02:49.485]只要那幸福在心底\\n[02:53.351]哪怕我一人演戏\\n[03:02.215]其实每个人的心里都有一颗小星星\\n",
        "[00:00.000] 作词 : 汪苏泷\\n[00:00.016] 作曲 : 汪苏泷\\n[00:00.032] 编曲 : 张楚弦\\n[00:00.50]吉他&贝斯：张楚弦\\n[00:00.70]监制：宋鹏飞\\n[00:00.90]音乐出品发行公司：听见时代传媒\\n[00:01.26]\\n[00:01.93]脚踏车的后座和你干净的衣裳\\n[00:08.27]那些时光漫长仿佛夏天永远晴朗\\n[00:15.52]香樟花开满路旁\\n[00:18.59]被下课铃声轻敲\\n[00:22.04]弹奏着 青涩乐章\\n[00:27.37]\\n[00:29.59]你总爱把书包丢过爬满藤蔓的墙\\n[00:36.31]一起谈天说地直到把路灯全部点亮\\n[00:43.30]落叶翻飞过画卷\\n[00:46.86]摊开时间的手掌\\n[00:49.68]你笑起来 乌云散开\\n[00:56.14]\\n[00:57.04]故事的发展有很多意外\\n[01:00.16]有你在的结果总不太坏\\n[01:03.85]那些女孩教会我关于爱\\n[01:07.12]远去人海\\n[01:10.50]\\n[01:11.18]稚气的少年幻想着未来\\n[01:14…0.90]一起谈天说地直到把路灯全部点亮\\n[02:08.00]落叶翻飞过画卷\\n[02:11.44]摊开时间的手掌\\n[02:14.40]你笑起来 乌云散开\\n[02:21.42]\\n[02:21.78]故事的发展有很多意外\\n[02:25.01]有你在的结果总不太坏\\n[02:28.25]那些女孩教会我关于爱\\n[02:31.65]远去人海\\n[02:35.52]\\n[02:35.86]稚气的少年幻想着未来\\n[02:38.85]一尘不染纯白色的年代\\n[02:42.38]那个陪伴我成长的男孩\\n[02:45.81]还好有你在\\n[02:50.20]\\n[02:50.46]故事的发展有很多意外\\n[02:53.22]有你在的结果总不太坏\\n[02:56.56]那些女孩教会我关于爱\\n[03:00.13]远去人海\\n[03:04.16]稚气的少年幻想着未来\\n[03:07.29]一尘不染纯白色的年代\\n[03:10.93]那个陪伴我成长的男孩\\n[03:14.06]还好有你在\\n[03:17.76]\\n[03:19.13]脚踏车的后座和你干净的衣裳\\n[03:25.72]那些时光漫长仿佛夏天永远晴朗\\n",
        "[00:00.000] 作词 : 汪苏泷\\n[00:00.507] 作曲 : 汪苏泷\\n[00:01.014] 编曲 : 金若晨\\n[00:01.521] 制作人 : 胡皓/汪苏泷\\n[00:02.30]编曲 : 汪苏泷\\n[00:31.88]终于等到响起了下课铃\\n[00:34.62]已经约好在操场等你\\n[00:37.12]夏天真的是闷的可以\\n[00:39.55]带你去吃草莓冰淇淋\\n[00:42.04]如果你有一点坏心情\\n[00:44.54]我为你弹肖邦圆舞曲\\n[00:46.97]听到这首轻松的旋律\\n[00:49.47]好像吃了夹心巧克力\\n[00:52.40]当我偷偷看你\\n[00:54.46]当我偷偷的想着你\\n[00:56.90]想些深奥的问题\\n[00:59.90]我们的爱情是丘比特安排的游戏\\n[01:05.15]还是月下老人他傻傻分不清\\n[01:10.14]你说靠在我的肩膀有心电感应\\n[01:14.95]说不清又不像是梦境\\n[01:19.07]我们的爱情是两颗星星眯着眼睛\\n[01:24.68]还是命中注定我们会在一起\\n[01:29.80]牛顿说过有种东西叫万有引力\\n[0…5.62]每天拿着苹果想定律\\n[02:08.12]可爱到连吃饭都忘记\\n[02:11.30]当我偷偷看你\\n[02:13.23]当我偷偷的想着你\\n[02:15.73]想些深奥的问题\\n[02:18.66]我们的爱情是丘比特安排的游戏\\n[02:23.84]还是月下老人他傻傻分不清\\n[02:28.90]你说靠在我的肩膀有心电感应\\n[02:33.70]说不清又不像是梦境\\n[02:38.71]我们的爱情是两颗星星眯着眼睛\\n[02:43.46]还是命中注定我们会在一起\\n[02:48.58]牛顿说过有种东西叫万有引力\\n[02:54.06]我因为你开始相信\\n[02:57.81]那些大道理\\n[03:02.93]我们的爱情是丘比特安排的游戏\\n[03:08.23]还是月下老人他傻傻分不清\\n[03:13.23]你说靠在我的肩膀有心电感应\\n[03:18.15]说不清又不像是梦境\\n[03:22.46]我们的爱情是两颗星星眯着眼睛\\n[03:27.83]还是命中注定我们会在一起\\n[03:32.75]牛顿说过有种东西叫万有引力\\n[03:38.31]我因为你开始相信\\n[03:41.93]那些大道理\\n",
        "[00:00.000] 作词 : Finale\\n[00:01.000] 作曲 : 汪苏泷\\n[00:33.35]我总是轻描淡写告诉你我的愿望\\n[00:37.83]也给你千言万语都说不尽的目光\\n[00:41.69]这世界总有人在忙忙碌碌寻宝藏\\n[00:45.62]却误了浮世骄阳 也错过人间万象\\n[00:49.97]古城里长桥上\\n[00:53.39]人如海车成行\\n[00:56.93]你笑得像光芒\\n[01:00.42]蓦然把我照亮\\n[01:02.49]你笑得像光芒\\n[01:03.86]蓦然把我照亮\\n[01:05.85]风轻扬夏未央\\n[01:10.08]林荫路单车响\\n[01:13.57]原来所谓爱情\\n[01:16.80]是这模样\\n[01:19.73]就承认一笑倾城一见自难忘\\n[01:24.83]说什么情深似海我却不敢当\\n[01:28.87]最浪漫不过与你并肩看夕阳\\n[01:32.73]我心之所向\\n[01:36.21]想和你游四方赏晴雨的风光\\n[01:41.19]想和你铺纸笔写余生的篇章\\n[01:45.04]笑与泪都分享管情节多跌宕\\n[01:49.25]我们不散场\\n[01:53.29]\\n[02:11.54]你是我偶然听闻铭感于心的歌唱\\n[02:15.29]也是我惊鸿一瞥而后拥抱的芬芳\\n[02:19.27]这世界风华正茂可别辜负好时光\\n[02:23.13]六月风走街穿巷 六月花陌上盛放\\n[02:27.41]古城里长桥上\\n[02:30.22]人如海车成行\\n[02:34.94]你笑得像光芒\\n[02:37.86]蓦然把我照亮\\n[02:40.09]你笑得像光芒\\n[02:41.39]蓦然把我照亮\\n[02:43.45]风轻扬夏未央\\n[02:47.11]林荫路单车响\\n[02:51.09]原来所谓爱情\\n[02:54.76]是这模样\\n[02:57.81]就承认一笑倾城一见自难忘\\n[03:02.74]说什么情深似海我却不敢当\\n[03:06.60]最浪漫不过与你并肩看夕阳\\n[03:10.45]我心之所向\\n[03:13.75]想和你游四方赏晴雨的风光\\n[03:18.67]想和你铺纸笔写余生的篇章\\n[03:22.82]笑与泪都分享管情节多跌宕\\n[03:26.61]我们不散场\\n[03:30.57]\\n",
        "[00:00.000] 作词 : 汪苏泷\\n[00:01.000] 作曲 : 汪苏泷\\n[00:02.000] 编曲 : 金若晨@光合声动\\n[00:03.000] 制作人 : 胡皓/汪苏泷\\n[00:17.700]我曾和你走过多少个的秋末\\n[00:21.160]我曾紧紧握着你手臂的脉搏\\n[00:24.890]看你脸上的酒窝\\n[00:26.690]唱着背叛的情歌 情绪不由我\\n[00:31.110]我曾带你去看星空下的花火\\n[00:35.260]我曾把我的爱都交给你挥霍\\n[00:38.850]这世界爱情好多\\n[00:40.700]结局未必有几个 这痛算什么\\n[00:44.600]我在无人的街头 想念着某某\\n[00:48.140]你在别人的宇宙 施舍着温柔\\n[00:51.730]我能给的风度是微笑着默默放开手\\n[00:58.140]我知道你的眼泪只是一种无奈\\n[01:02.190]何必虚情假意的勾勒着未来\\n[01:05.670]当爱已不存在 我又为谁等待\\n[01:09.250]嘲笑命运这幽默的安排\\n[01:12.480]我知道你的挽回只是一种习惯\\n[01:16.090]也曾为难你…\\n[02:33.770]嘲笑命运这幽默的安排\\n[02:36.820]我知道你的挽回只是一种习惯\\n[02:40.520]也曾为难你有多么害怕孤单\\n[02:44.200]故事可以重来 时光却已不再\\n[02:47.780]感情需要一点点的空白\\n[02:50.620]来整理遗憾\\n[02:53.420]\\n[02:54.400]我知道你的眼泪只是一种无奈\\n[02:57.810]何必虚情假意的勾勒着未来\\n[03:02.030]当爱已不存在 我又为谁等待\\n[03:05.150]嘲笑命运这幽默的安排\\n[03:08.080]我知道你的挽回只是一种习惯\\n[03:12.160]也曾为难你有多么害怕孤单\\n[03:15.640]故事可以重来 时光却已不再\\n[03:19.310]感情需要一点点的空白\\n[03:22.170]来整理遗憾\\n[03:26.250]\\n[03:28.250]和声编写：胡皓@光合声动\\n[03:29.250]和声：汪苏泷 阿莲\\n[03:30.250]吉他：谷粟\\n[03:31.250]录音：任寒冰@北京光合声动录音室\\n[03:32.250]混音：任寒冰@北京光合声动录音室\\n",
        "纯音乐"
    ];

    window.onclick = function (){
        jspPane.innerHTML = ""
        var lineno = 0;
        var resut = parselyr(textList[current_audio - 1]);

        for (var i = 0; i < resut.length; i++) {
            var newElementP = document.createElement("span");
            var newElementP1 = document.createElement("br");
            var text = document.createTextNode(resut[i].content);
            newElementP.append(text);

            jspPane.appendChild(newElementP);
            jspPane.appendChild(newElementP1);
        }

        //显示高亮

        var li = jspPane.querySelectorAll('span');

        function highLight() {
            li[lineno].classList.add("active");

            if (lineno > 1)
                li[lineno - 1].classList.remove("active");
            if (li[0].classList.contains('active') && lineno > 1)
                li[0].classList.remove("active");
        }
        function scrollToTop(height){
            var htop = jspPane.scrollTop;
            var hhg = jspPane.scrollHeight;
            if (height + htop >= hhg) {
                jspPane.scrollTop = 0;
            } else {
                jspPane.scrollTop = htop + height;
            }
        }

        audio.addEventListener("timeupdate", function () {
            if (lineno == resut.length || audio.currentTime == audio.duration || audio.onended) return;

            lineno = getLineNo(audio.currentTime);
            highLight();
            lineno++;
        });

        // 当快进或者倒退的时候，找到最近的后面那个
        function getLineNo(currentTime) {
            if (currentTime >=parseFloat(resut[lineno].time) && currentTime <= audio.duration ) {                // 快进
                for (let i = resut.length - 1; i >= lineno; i--) {
                    if (currentTime >= parseFloat(resut[i].time)) {
                        if (i > 6)
                            scrollToTop(37.5);
                        return i;
                    }
                }
            } else {
                // 后退
                for (let i = 0; i <= lineno; i++) {
                    if (currentTime <= parseFloat(resut[i].time)) {
                        return i - 1;
                    }
                }
            }
        }
        //播放结束自动回到开头
        audio.addEventListener("ended", function() {
            lineno = 0;
            highLight();
            audio.play();
            jspPane.scrollTop = 0;
        });

    }

    var video = document.getElementsByClassName("headerA")[1];
    var videopage = document.getElementsByClassName("videopage")[0]
    video.onclick = function () {
        if (videopage.style.display = "none")
            videopage.style.display = "block";

    };

    var listmnav = document.getElementsByClassName("listmnav")[0];
    var lb = document.getElementsByClassName("lb")[0];
    lb.onclick = function () {
        if (listmnav.style.display == "none") {

            listmnav.style.display = "block";
        }   else {

            listmnav.style.display = "none";
        }
    };


    var k = document.getElementsByClassName("k")[0];
    var pit = document.getElementsByClassName("piture")[0];
    var btnp = document.getElementsByClassName("btnp")[0];
    k.onclick = function () {
        pit.style.visibility = "visible";
        // pit.style.height = "200%";
        
    };
    btnp.onclick = function () {
        pit.style.visibility = "hidden";
        pit.style.height = "99%";
        
    };
    var btnv = document.getElementsByClassName("btnv")[0];
    btnv.onclick = function () {
        videopage.style.display = "none";
        
    };


    var vipico = document.getElementsByClassName("vip")[0];
    vipico.onclick = function() {
        vipico.href = "loginPage.html";
    }

    var vediobf = document.getElementsByClassName("vediobf")[0];
    var vimg = document.getElementsByClassName("vimg")[0];
    var video = document.getElementById("video");
    vediobf.onclick = function() {
        if (video.paused){
            video.play();
            vimg.src = "./img/vzt.png";
        } else {
            video.pause();
            vimg.src = "./img/vbf.png";
        }   
    }
};


